package com.cskaoyan.bean.admin;

import com.cskaoyan.bean.po.MarketAdmin;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author LiangRuiJiang
 * @since 2022/06/06  19:44
 */
@Data
public class AdminCreateVo {

    private Integer id;
    private String password;
    private Date addTime;
    private Date updateTime;
    private String avatar;
    private String username;
    private Integer[] roleIds;

    public static AdminCreateVo data(MarketAdmin admin) {
        AdminCreateVo adminNew = new AdminCreateVo();
        adminNew.setId(admin.getId());
        adminNew.setAddTime(admin.getAddTime());
        adminNew.setAvatar(admin.getAvatar());
        adminNew.setPassword(admin.getPassword());
        adminNew.setRoleIds(admin.getRoleIds());
        adminNew.setUpdateTime(admin.getUpdateTime());
        adminNew.setUsername(admin.getUsername());
        return adminNew;
    }
}
